package com.mkyong.template.dao.impl;

import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.mkyong.template.dao.TemplateDao;
import com.mkyong.template.model.Template;

public class TemplateDaoImpl extends HibernateDaoSupport implements TemplateDao{
	//return all the Template in list
	public List<Template> listTemplate(){
		
		return getHibernateTemplate().find("from Template");
		
	}
	
	public int queryResultsCount(){
		
		return this.queryResultsCount();		
	}
	
	public List<Template> queryByPage(int from, int length){
		return this.queryByPage(from, length);
	}
	
	public void addTemplate(Template template)
	{
		getHibernateTemplate().save(template);
	}
	
}
